package com.t.blog.controller;

import com.t.blog.service.ThemesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.t.pro.vo.ThemesVo;
import t.microservices.fw.common.interResult.R;

import java.util.List;

/**
 * 〈一句话功能简述〉<br>
 * 〈主题业务控制类〉
 *
 * @author a0000
 * @create 2024/1/27 18:37
 * @since 1.0.0
 */
@RestController
@CrossOrigin
@RequestMapping("themes")
public class ThemesController {

    @Autowired
    private ThemesService themesService;

    @GetMapping
    public R  getThemsList(){
        return R.success(themesService.getThemsList());
    }

    @PostMapping
    public R insertThemesList(@RequestBody List<ThemesVo> themesVos){
        themesService.insertThemesList(themesVos);
        return R.success("保存成功！");
    }

}
